package ca.quicko.dao.jpa;

import java.util.List;

import javax.persistence.Query;

import org.appfuse.dao.jpa.GenericDaoJpa;
import org.appfuse.model.User;

import ca.quicko.dao.ActDao;
import ca.quicko.model.Act;

/**
 * @author <a href="mailto:eric.s.landry@gmail.com">Eric S. Landry</a>
 */
public class ActDaoJpa extends GenericDaoJpa<Act, Long> implements ActDao {
	public ActDaoJpa() {
		super(Act.class);
	}

	@SuppressWarnings("unchecked")
	public List<Act> findByUser(User user) {
		Query q = super.entityManager.createQuery("select u from User u where u.id=?");
        q.setParameter(1, user.getId());
        return q.getResultList();
	}
}
